# -*- coding: utf-8 -*-

f = open("teste.txt", "w")
s = "treta"
for k in range(10): f.write(s); f.write("\n")
f.close()
f = open("teste.txt", "r")
f.seek(5)
print f.tell()
x = f.read(10)
print x
c =  0
for line in f:
    print "{0}: ".format(c), line
    c += 1
f.close()
with open("teste.txt", "r") as f:
    x = f.readline()
    if x == 'treta \n': print "voila"
    
